<template>
  <el-container>
    <el-header>
      <home-header @collapse="collapse"></home-header>
    </el-header>
    <el-container>
      <el-aside :width="asideWidth">
        <sidebar/>
      </el-aside>
      <el-main>
        <div id="mainPage">
          <router-view/>
        </div>
      </el-main>
    </el-container>
  </el-container>
</template>


<script>
  import { getAction } from "../axios/HttpUtils";
  import homeHeader from "../components/homeHeader";
  import Vue from 'vue'
  import Sidebar from "../components/sidebar";
  export default {
      name: "Home",
    components: {Sidebar, homeHeader},
    data() {
          return {
            url: 'https://api.coindesk.com/v1/bpi/currentprice.json',
            info: undefined,
            asideWidth: "251px"
          }
      },
      methods: {
        collapse(b){
          console.log(b);
          if(b){
            this.asideWidth = "60px";
          }else {
            this.asideWidth = "251px";
          }
        },
        showHomePage(){
          console.log(2222);
        },
        click () {
          let sysPermissionVos = Vue.ls.get("sysPermissionVos");
          console.log(typeof sysPermissionVos);
          getAction(this.url).then(res => {
            console.log(res);
            this.info = res;
          })
          let token = Vue.ls.get("token");
          this.$message({
            message: token,
            type: 'success'
          });
        }
      }
    }
</script>

<style scoped>
  .el-header{
    padding: 0px;
  }
  #mainPage{

  }
</style>
